﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace AlgoritmoConstrutivo.entidades
{
    [Serializable]
    public class Vizinhos : Collection<No>
    {
        public Vizinhos() : base() 
        {
        }

        private List<int> pesos = new List<int>();

        public List<int> Pesos
        {
            get { return pesos; }
            set { pesos = value; }
        }

 
        public No FindByValue(int value)
        {
            // search the list for the value
            foreach (No node in Items)
                if (node.Id.Equals(value))
                    return node;

            // if we reached here, we didn't find a matching node
            return null;
        }
    }
}
